

<%@ page import="givenchy.Task" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'task.label', default: 'Task')}" />
        <title>添加任务</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
            <span class="menuButton"><g:link class="list" action="list">任务列表</g:link></span>
        </div>
        <div class="body">
            <h1>添加任务<br><a href="javascript:" rel="tipsy" title="<font color='#000'>权重：</font>按照你的任务的重要程度来定义，越重要数值越大，被刷的几率也就越大。<br><font color='#000'>动作：详细内容请查看【帮助】<br><font color='red'>VIP用户注意，请将广告任务添加到能执行广告点击的任务组中。</font>">点击查看提示</a></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${taskInstance}">
            <div class="errors">
                <g:renderErrors bean="${taskInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" name="taskForm">
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">名称</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" value="${taskInstance?.name}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="seek">权重</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'seek', 'errors')}">
                                    <g:textField size="2"  maxlength="1" name="seek" value="${fieldValue(bean: taskInstance, field: 'seek')}" />
                                </td>
                            </tr> 
                         
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="actions">动作</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'actions', 'errors')}">
                                    
                                    <table style="border:0;">
                                    <tr>
                                        <td ><g:textArea style="width:400px;height:250px;" name="actions" value="${taskInstance?.actions}" /></td>
                                        <td>
<pre>
eg://   name , target ,value
open, http://www.baidu.com
sleep, 5
input, id|kw, 山寨机
sleep, 3
click, id|su
sleep, 3
click, link|www.shanzhaiji.cn
open, www.shanzhaiji.cn
sleep, 3
clickad, googleads.g.doubleclick.net
sleep, 3
quit, quit
</pre>
                                    </td>
                                    </tr>
                                    </table>
                                    
                                </td>
                            </tr>
                          
                            <input type="hidden" name="taskGroup.id" value="${taskInstance?.taskGroup?.id}">
                         
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="完成" /></span>
                </div>
            </g:form>
        </div>
         <g:javascript src="validate/jquery.validate.js" type="text/javascript"/>
        <g:javascript src="domain/task_create.js" type="text/javascript"/>
    </body>
</html>
